package top.letscode.adclicker.util;

import java.util.Arrays;
import java.util.List;

public class SetResUtil {

  private static final String CMD_TPL = "cmd /c SetRes.exe h%s v%s b%s f60";
  private static List<String> RESOLUTION_LIST =
      Arrays.asList("1024,768,32", "1366,768,32", "1280,720,32");

  public static void changeScreenResolution() {
    try {
      String resolution = RandomUtil.random(RESOLUTION_LIST);
      String[] arr = resolution.split(",");
      Process process = Runtime.getRuntime().exec(String.format(CMD_TPL, arr[0], arr[1], arr[2]));
      process.waitFor();
    } catch (Exception e) {// ignore
      e.printStackTrace();
    }
  }

  public static void main(String[] args) {
    changeScreenResolution();
  }
}
